Skip to content

chore: defer mcp SDK import to first MCP usage#2675

Merged
copybara-service[bot] merged 1 commit into
mainfrom
copybara/905291907
Jul 14, 2026
Merged

chore: defer mcp SDK import to first MCP usage#2675
copybara-service[bot] merged 1 commit into
mainfrom
copybara/905291907

Conversation

@copybara-service

Copy link
Copy Markdown

chore: defer mcp SDK import to first MCP usage

import google.genai no longer eagerly imports mcp. The public
symbols McpClientSession, McpCallToolResult, and mcp_types
resolve lazily on first attribute access (PEP 562 __getattr__).

@hyperare80-pixel hyperare80-pixel left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main

@copybara-service copybara-service Bot force-pushed the copybara/905291907 branch 6 times, most recently from 5d1755d to 17842a1 Compare July 14, 2026 21:26
`import google.genai` no longer eagerly imports `mcp`. The public
symbols `McpClientSession`, `McpCallToolResult`, and `mcp_types`
resolve lazily on first attribute access (PEP 562 `__getattr__`).

PiperOrigin-RevId: 947927483
@copybara-service copybara-service Bot force-pushed the copybara/905291907 branch from 17842a1 to d38eaca Compare July 14, 2026 22:07
@copybara-service copybara-service Bot merged commit d38eaca into main Jul 14, 2026
@copybara-service copybara-service Bot deleted the copybara/905291907 branch July 14, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants